package io.demo03;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author cyt
 * @create 2020-02-25 17:39
 */
public class CopyPic {

    public static void main(String[] args) throws IOException {

        String sour = "f:\\1.png";
        String dir = "f:\\2.png";
        File dirfile = new File(sour);
        System.out.println("源文件的地址：" + dirfile.getAbsolutePath());
        System.out.println("源文件的长度："+dirfile.length());
        FileInputStream inputStream = new FileInputStream(sour);
        FileOutputStream outputStream = new FileOutputStream(dir);

        int temp;
        while ((temp = inputStream.read()) != -1) {
            outputStream.write(temp);
        }

    }

}
